package com.util;

import com.phifan.book_jobs.R;

import android.app.Activity;
import android.util.DisplayMetrics;

public class ScreenManager {

	public int width = 480;
	public int height = 800;
	public int actural_height = 800;
	public int bg_int = 0;
	
	private static ScreenManager instance = null;
	
	private ScreenManager() {
		
	}
	
	public static void init(Activity act) {
		DisplayMetrics dm = new DisplayMetrics();
		act.getWindowManager().getDefaultDisplay().getMetrics(dm);
		if(instance == null) {
			instance = new ScreenManager();
		}
		instance.actural_height = dm.heightPixels;
		instance.width = dm.widthPixels;
		instance.height = dm.heightPixels - 72;
		if(instance.actural_height == 800 && instance.width == 480) {
			//instance.bg_int = R.drawable.shelf_bkg;
			instance.bg_int = R.drawable.bk1;
		} else if(instance.actural_height == 854 && instance.width ==480) {
			instance.bg_int = R.drawable.a854;
		}else if(instance.actural_height == 480 && instance.width == 320) {
			instance.bg_int = R.drawable.a854;
		} else {
			instance.bg_int = 0;
		}
	}
	
	public static ScreenManager getScreen() {
		return instance;
	}
}
